package com.forever7776.life.core.mapper.admin;

import com.forever7776.life.core.entity.admin.AdminUser;
import com.baomidou.mybatisplus.mapper.BaseMapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

/**
 * <p>
 * 管理员用户表 Mapper 接口
 * </p>
 *
 * @author kz
 * @since 2018-01-18
 */
public interface AdminUserMapper extends BaseMapper<AdminUser> {


    /**
     * 更新用户登录时间
     *
     * @param username
     * @return
     */
    @Update("update admin_user set login_time=now() where username=#{username}")
    int updateLoginTime(@Param("username") String username);

    /**
     * 更新用户登出时间
     *
     * @param username
     * @return
     */
    @Update("update admin_user set logout_time=now() where username=#{username}")
    int updateLogoutTime(@Param("username") String username);
}